Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow arbitrary space indentation #7818

Conversation

Rasmus-Bertell
Copy link

@Rasmus-Bertell Rasmus-Bertell commented Feb 4, 2024

I created this PR to address the issue in #7810.

Removes the limitation of having only 2 or 4 space indentation and allows for any number of spaces or one tab in the indentation settings.

This could be modified to also allow for any number of tabs but I don't see a reason for it since tabs are already arbitrary sized.

@Rasmus-Bertell Rasmus-Bertell changed the title Feature: Allow arbitrary space indentation feat: allow arbitrary space indentation Feb 4, 2024
@coveralls
Copy link

coveralls commented Feb 4, 2024

Coverage Status

coverage: 94.753%. remained the same
when pulling 9bd8035 on Rasmus-Bertell:feature/allow-arbitrary-space-indentation
into fe8f7fd on PHP-CS-Fixer:master.

@Wirone Wirone requested a review from keradus February 4, 2024 16:16
Copy link
Member

@keradus keradus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's solve the discussion before concluding on PR

#7810

@@ -25,8 +25,8 @@ final class WhitespacesFixerConfig

public function __construct(string $indent = ' ', string $lineEnding = "\n")
{
if (!\in_array($indent, [' ', ' ', "\t"], true)) {
throw new \InvalidArgumentException('Invalid "indent" param, expected tab or two or four spaces.');
if (!Preg::match('/^(?: +|\t)$/', $indent)) {
Copy link
Member

@keradus keradus Feb 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF we would go forward direction to approve the PR, we need a new tests to prove it works:

  • each fixer that uses WhitespacesFixerConfig should receive a new test with new whitespace variant(s)
  • dedicated integration tests for new whitespace variant(s) (at least mimic tests/Fixtures/Integration/set/@PSR12_whitespaces.test*.php)

(i suggest to not invest into it till aligned into direction)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll convert this to a draft while I familiarize myself more with the codebase.

Copy link

github-actions bot commented Aug 5, 2024

Since this pull request has not had any activity within the last 90 days, I have marked it as stale.

The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.

You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.

I will close it if no further activity occurs within the next 14 days.

Please keep your branch up-to-date by rebasing it when main branch is ahead of it, thanks in advance!

Copy link

The fact this was automatically closed doesn't mean that the idea got rejected - it simply didn't get any priority for way too long to keep it open. If you're still interested in this, please let as know, we can consider re-opening it. When it comes to pull requests it may be better to create new one, on top of main branch.

@github-actions github-actions bot added the status/to recover PRs that were closed without being merged, but can be refreshed and continued label Aug 30, 2024
@github-actions github-actions bot closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/stale status/to recover PRs that were closed without being merged, but can be refreshed and continued
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants